{% extends "aside/erp/base.html" %}
{% load staticfiles %}
{% block custom_tdk %}
    <title>物流管理 - WanFeng</title>
    <meta name="description" content="物流管理">
{% endblock %}

{% block page-title %}速卖通渠道设置{% endblock %}

{% block app-body %}

<div class="padding">
<div class="box">

<div class="row p-a">

    <div class="col-sm-6">
        <input id="filter" type="text" class="form-control inline m-r">
    </div>
    <div class="col-sm-6">
        <div class="row">
            <div class="col-sm-4">
                <button class="btn btn-fw dark text-white" data-toggle="modal" data-target="#modal-addChannel">添加物流渠道</button>
            </div>
            <div class="col-sm-8">
                <select class="custom-select" id="selectChannelType">
                    <option value="0">全部渠道</option>
                    <option value="1">燕文线下渠道</option>
                    <option value="2" selected>速卖通线上渠道</option>
                </select>
            </div>
        </div>

    </div>

</div>


<div class="table-responsive">

    <table class="table table-striped table-hover b-t">
        <thead>
        <tr>
            <th style="width:20px"><label class="ui-check m-a-0">
                <input type="checkbox" id="action-toggle">
                <i></i></label></th>
            <th>等级</th>
            <th>展示名称（中/英）</th>
            <th>服务代码</th>
            <th>排序</th>
            <th>匹配规则</th>
            <th style="width:70px;">时效</th>
            <th>是否启用</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="companyListBox">
        {% for channel in channelData %}
        <tr>
            <td><label class="ui-check m-a-0">
                <input type="checkbox" name="post[]" value="{{ channel.ID }}">
                <i class="dark-white"></i></label></td>
            <td>{{ channel.serviceLevel }}</td>
            <td>{{ channel.displayNameCN }} / {{ channel.displayName }}</td>
            <td>{{ channel.serviceName }}</td>
            <td>{{ channel.recommendOrder }}</td>
            <td>{{ channel.trackingNoRegex }}</td>
            <td>{{ channel.minProcessDay }} - {{ channel.maxProcessDay }}</td>
            <td>
                <div class="col-sm-10"><label class="ui-switch danger m-t-xs m-r"><input type="checkbox" {% ifnotequal channel.enabled '0' %}checked="checked"{% endifnotequal %} class="has-value channelEnble" data-val="{{ channel.serviceName }}" data-type="parent"> <i></i></label></div>
            </td>
            <td>
                <a href="javascript:;" class="text-info editChannel" data-val="{{ channel.serviceName }}" data-serviceName="{{ channel.displayNameCN }}">管理</a>
            </td>
        </tr>
        {% endfor %}
        </tbody>

    </table>
</div>


<div id="modal-editChannel" class="modal fade" data-backdrop="true">
    <div class="row-col h-v">
        <div class="row-cell v-m">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title">物流承运商管理<span></span> <a data-dismiss="modal" class="pull-right text-muted text-lg m-r-sm">×</a></h5>
                    </div>
                    <div class="modal-body p-lg">
                        <input id="filter" type="text" class="form-control input-sm w-auto inline m-r">
                        <table class="table m-b-none" data-ui-jp="footable" data-filter="#filter" data-page-size="5">
                            <thead>
                            <tr>
                                <th data-toggle="true">物流承运商名称</th>
                                <th data-hide="phone">时效</th>
                                <th data-hide="phone">启用状态</th>
                                <th data-hide="phone">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            </tbody>
                            <tfoot class="hide-if-no-paging"><tr><td colspan="4" class="text-center"><ul class="pagination"></ul></td></tr></tfoot>
                        </table>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn dark p-x-md" data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="modal-editChannelInfo" class="modal black-overlay" data-backdrop="false">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title"><span>修改服务商自定义名称</span> <a data-dismiss="modal" class="pull-right text-muted text-lg p-a-sm m-r-sm">×</a></h5>

            </div>
            <div class="modal-bodyp-lg m-l-1 m-r-3 row p-a">
                <input type="hidden" id="editLogisticsServiceId" value="None"/>

                <div class="col-sm-10"><input type="text" class="form-control" name="channelDiyName" id="channelDiyName" /></div>
                <div class="col-sm-2">
                    <button class="btn btn-fw info" id="saveChannelDiy">保存</button></div>
            </div>
            <div class="modal-footer">
                        <button type="button" class="btn dark p-x-md" data-dismiss="modal">关闭</button>
                    </div>

        </div>
    </div>
</div>

<footer class="light lt p-a">

</footer>
</div>
</div>


{% endblock %}